

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2024-02-09
 * Time:12:48
 */
public class Test {
    public static void main1(String[] args) {
        BinarySearchTree binarySearchTree = new BinarySearchTree();
        binarySearchTree.insert(1);
        binarySearchTree.insert(5);
        binarySearchTree.insert(6);
        binarySearchTree.insert(2);
        binarySearchTree.insert(4);
        binarySearchTree.insert(3);
        System.out.println("================");
        boolean ret = binarySearchTree.remove(7);
        System.out.println(ret);
        boolean ret1 = binarySearchTree.remove(1);
        System.out.println(ret1);
        boolean ret2 = binarySearchTree.remove(4);
        System.out.println(ret2);
        boolean ret3 = binarySearchTree.remove(4);
        System.out.println(ret3);
        boolean ret4 = binarySearchTree.remove(6);
        System.out.println(ret4);
    }
///////////////////////////////////////////////////////////
    public static void main(String[] args) {
        Solution.TreeNode node1 = new Solution.TreeNode(5);
        Solution.TreeNode node2 = new Solution.TreeNode(1);
        Solution.TreeNode node3 = new Solution.TreeNode(4);
        Solution.TreeNode node4 = new Solution.TreeNode(3);
        Solution.TreeNode node5 = new Solution.TreeNode(6);

        node1.left = node2;
        node1.right = node3;
        node3.left = node4;
        node3.right = node5;

        Solution solution = new Solution();
        boolean ret = solution.isValidBST(node1);
        System.out.println(ret);
    }
}
